#include<iostream>
using namespace std;
int main()
{
	int n = 0;
	cin >> n;
	int arr[100005] = {0};
	for(int i = 0; i < n; i++){
		int k = 0;
		cin >> k;
		arr[k]++;
	}
	int cnt = 0;
	int sum1 = 0, sum2 = 0;
	for(int i = 0; i < n; i++){
		if(arr[i] == 1)
			sum1++;
		else if(arr[i] > 1)
			sum2 += arr[i] - 2;
	}
	if(sum2 > sum1)
		cnt = sum2;
	else
		cnt = (sum1 - sum2) / 2 +sum2;
	cout << cnt;
	return 0;
}
